(function (doc, win) {
    var docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in win? 'orientationchange' : 'resize',
        recalc = function () {
               //  var clientWidth = docEl.clientWidth;
               // if (clientWidth === undefined) return;
//                 docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
             var clientHeight=docEl.clientHeight;
             // console.log(clientHeight);
             if(clientHeight == undefined)return;
            docEl.style.fontSize = 20 * (clientHeight / 1200) + 'px';
        };
    if (doc.addEventListener === undefined) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
